<?php session_start(); ?>

<?php

    if(isset($_GET['del']))
    {
        include "Datasource.php";
        include "WorkDone.php";
        include "WorkDoneDao.php";

        $conn = new Datasource("localhost","theanykey","root","");
        $workDone = new WorkDone();
        $workDoneDao = new WorkDoneDao();

        $workDoneID = $_GET['wrkid'];
        $workDone = $workDoneDao->getObject($conn, $workDoneID);
        $workDoneDao->delete($conn, $workDone);



    }

?>


<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <LINK REL=StyleSheet HREF="maintenancePagesCSS.css" TYPE="text/css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body <?php if(isset($_GET['del'])){ print(" onload='closeRefresh();'");}  ?>>

        <center>
        <form action='WorkDoneDelete.php?wrkid=<?php print($_GET['wrkid']);?>&del=true' method='post'>
            <p>Are you sure you want to delete this work done entry?</p>
            <input type='submit' value="Delete">
            <input type="button" value="Cancel" onclick="window.close();">

        </form>
        </center>


    </body>

    <script type="text/javascript">
        function closeRefresh()
        {
            w = window.opener;
            window.opener.location.href = window.opener.location.href;
            window.close();

         }


    </script>
</html>
